﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>蒋峰健康商城后台登录</title>
    <link type="text/css" rel="stylesheet" href="static/css/login.css" />
    <link type="text/css" rel="stylesheet" href="static/css/message2.css">
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">


</head>

<body>
<input type="hidden" id="flag" value="${flag}">
<div class="main">
    <div class="main0">
        <div class="main_left">
            <img src="static/images/login-image-3.png" class="theimg"/>
            <img src="static/images/login-image-2.png" class="secimg"/>
            <img src="static/images/login-image-1.png" class="firimg"/>
        </div>
        <div class="main_right">
            <div class="main_r_up">
                <img src="static/images/user.png" />
                <div class="pp">蒋峰健康商城后台登录</div>
            </div>
            <div class="sub"><p>还没有账号？<a href="/register.jsp"><span class="blue">立即注册</span></a></p></div>
          <!--登录-->
            <div id="app">
            <div class="txt">
                    <span style="letter-spacing:8px;">用户名:</span>
                    <input name="account" type="text"v-model="account"  class="txtphone" placeholder="请输入注册邮箱账号"/>
                </div>
                <div class="txt">
                    <span style="letter-spacing:4px;">登录密码:</span>
                    <input name="password" type="text" v-model="password" class="txtphone" placeholder="请输入登录密码"/>
                </div>
                <input type="button" class="xiayibu" value="登录" @click="login(account,password)">
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="static/js/message.js"></script>
<script type="text/javascript" src="static/js/vue.js"></script>
<script type="text/javascript" src="static/js/axios-0.18.0.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script type="text/javascript">
var app=new Vue({
    el:"#app",
    data:{
        account:'',
        password:''
    },methods:{
        login(account,password){
            axios.post("/backstage/backstageLogin",{
                'account':account,
                'password':password
            }).then(data =>{
                if (data.data==true||data.data=='true'){
                    window.location.href="backstage/goPage";
                }else if (data.data==false||data.data=='false'){
                    this.$message.error('密码或账号错误');
                }else {
                    this.$message.error('你无该权限');
                }
            }).catch(e =>{
                this.$message.error('登录失败');
            });
        }
    }
});
</script>
</html>
